﻿using System.Collections.Generic;
using Shop.Base.Entity;
using Shop.Base.Interface;
using Shop.Server;
using Shop.Tools;

namespace Shop.Base.Server
{
    public class SystemRole:BaseServer<SystemRolePo>,ISystemRole
    {
        public List<SystemRolePo> GetPage(string roleName, int isDel, int pageIndex, int pageSize, out int total)
        {
            total = 0;
            return db.Queryable<SystemRolePo>().WhereIF(!roleName.IsNullOrEmpty(), $" RoleName like @RoleName ", new { RoleName = $"%{roleName}%" })
                .WhereIF(isDel>-1, $" isDel = @isDel ", new { isDel = isDel==1 })
                .ToPageList(pageIndex, pageSize, ref total);
        }
    }
}